package com.jic.market.enums;

import java.math.BigDecimal;

/**
 * description: FrontPromTypeConditionTypeEnum
 * date: 2020/2/29 17:44
 * author: wangys
 * version: 1.0
 */
public enum FrontPromTypeConditionTypeEnum {
    FULL_NUM_1(4, 1, "满量减", new BigDecimal(1), new BigDecimal(100)),
    FULL_NUM_2(5, 1, "满量折", new BigDecimal(1), new BigDecimal(10)),
    FULL_XY_1(6, 1, "满额减", new BigDecimal(100), new BigDecimal(100)),
    FULL_XY_2(7, 1, "满额折", new BigDecimal(100), new BigDecimal(10)),
    GIFT_XY_1(8, 1, "满金额赠", new BigDecimal(100), new BigDecimal(1)),
    GIFT_XY_2(9, 2, "满商品赠", new BigDecimal(1), new BigDecimal(1)),
    ZH_XY_1(12, 2, "第X件Y折", new BigDecimal(1), new BigDecimal(10)),
    ZH_XY_2(13, 2, "第X件Y元", new BigDecimal(1), new BigDecimal(100)),
    ZH_XY_3(14, 2, "满X件Y折", new BigDecimal(1), new BigDecimal(10)),
    HG_XY_1(15, 1, "满金额换购", new BigDecimal(100), new BigDecimal(1)),
    HG_XY_2(16, 2, "满量换购", new BigDecimal(1), new BigDecimal(1)),
    Complex_XY_1(22, 1, "x元y件", new BigDecimal(100), new BigDecimal(1)),
    Complex_XY_2(23, 2, "x件付y件", new BigDecimal(1), new BigDecimal(1)),
    Payment_1(29, 2, "we2000", new BigDecimal(100), new BigDecimal(100)),
    Payment_2(30, 2, "微信支付", new BigDecimal(100), new BigDecimal(100)),
    Payment_3(31, 2, "微众", new BigDecimal(100), new BigDecimal(100)),
    Payment_4(32, 2, "企业购", new BigDecimal(100), new BigDecimal(100)),
    ;
    private Integer frontPromType;
    private Integer conditionType;
    private String name;
    private BigDecimal conditionMultiply;
    private BigDecimal contentValueMultiply;

    public Integer getFrontPromType() {
        return frontPromType;
    }

    public Integer getConditionType() {
        return conditionType;
    }

    public String getName() {
        return name;
    }

    public BigDecimal getConditionMultiply() {
        return conditionMultiply;
    }

    public void setConditionMultiply(BigDecimal conditionMultiply) {
        this.conditionMultiply = conditionMultiply;
    }

    public BigDecimal getContentValueMultiply() {
        return contentValueMultiply;
    }

    public void setContentValueMultiply(BigDecimal contentValueMultiply) {
        this.contentValueMultiply = contentValueMultiply;
    }

    FrontPromTypeConditionTypeEnum(Integer frontPromType, Integer conditionType, String name, BigDecimal conditionMultiply, BigDecimal contentValueMultiply) {
        this.frontPromType = frontPromType;
        this.conditionType = conditionType;
        this.name = name;
        this.conditionMultiply = conditionMultiply;
        this.contentValueMultiply = contentValueMultiply;
    }
    public static FrontPromTypeConditionTypeEnum lookByFrontType(Integer frontPromType){
        if(frontPromType == null){
            return null;
        }
        for (FrontPromTypeConditionTypeEnum value : FrontPromTypeConditionTypeEnum.values()) {
            if(value.frontPromType == frontPromType){
                return value;
            }
        }
        return null;
    }
}
